package com.zxx.pattern.prototypePattern.prototype2_ZZ;

import androidx.annotation.NonNull;

/**
 * 原型模式 - PrototypePattern
 *
 * @author zxx on 2020/12/21
 */
public abstract class Shape2 implements Cloneable {

    private String id;
    protected String type;

    abstract void draw();

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getType() {
        return type;
    }


    @NonNull
    @Override
    protected Object clone() {
        Object clone = null;
        try {
            clone = super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
        }
        return clone;
    }
}
